{% extends base.html %}
{% block body %}

<div class="col-md-12 card">

    {% set title = "线程详情" %}
    {% set right_link = dict(link="javascript:history.back()", name="返回") %}
    {% include "common/base_title.html" %}

    <table class="table" border="border:#ff6600 1px solid">
        <tr>
            <th>编号</th>
            <th>Name</th>
            <th>is_alive</th>
            <th>处理器</th>
            <th>操作</th>
        </tr>
    {% for idx,thread in enumerate(thread_list) %}
        <tr>       
            <td>{{idx+1}}</td>
            <td>{{thread.getName()}}</td> 
            <td>{{thread.is_alive()}}</td>
            <td>{{thread.__dict__.get("handler_class")}}</td>
            <td><a class="view-detail" data-value="{{thread.__dict__}}">详情</a></td>
        </tr>
    {% end %}
    </table>
</div>

<script type="text/javascript">
$(function () {
    $(".view-detail").click(function (e) {
        var value = $(this).attr("data-value");
        layer.open({
            content: value
        });
    });
})
</script>

{% end %}